package com.macro.mall.oms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.macro.mall.oms.entity.OrderEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 订单 mapper
 *
 * @author xuyanjun
 * @date 2019-12-10
 */
public interface OrderMapper extends BaseMapper<OrderEntity> {

    /**
     * 修改预估分佣状态
     *
     * @param orderId 订单id
     * @return 受影响的行数
     */
    @Update("update oms_order set predicate_status=#{predictStatus} where id=#{id};")
    int updatePredictStatus(@Param("id") long orderId, @Param("predictStatus") int predictStatus);

    /**
     * 修改结算分佣状态
     *
     * @param orderId 订单id
     * @return 受影响的行数
     */
    @Update("update oms_order set settle_status=#{settleStatus} where id=#{id};")
    int updateSettleStatus(@Param("id") long orderId, @Param("settleStatus") int settleStatus);
}

